#pragma once
#include "ItemList.h"

namespace ItemMgr {

	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Collections;
	using namespace System::Windows::Forms;
	using namespace System::Data;
	using namespace System::Drawing;

	/// <summary>
	/// Summary for Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void);
//		{
//			InitializeComponent();
//			this->itemNameList->SelectionMode = SelectionMode::One;
////			this->
//
//			//
//			//TODO: Add the constructor code here
//			//
//		}



	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
				delete m_ItemList;
			}
		}
	//making this public is probably lazy, but I'll add a set of functions for it later
	public: System::Windows::Forms::ListBox^  itemNameList;
	//protected: 

	private: System::Windows::Forms::Label^  label1;
	private: System::Windows::Forms::PictureBox^  itemImage;

	public: System::Windows::Forms::GroupBox^  groupBox1;
	//private: 

	private: System::Windows::Forms::Label^  label2;
	private: System::Windows::Forms::RichTextBox^  itemDescriptionBox;

	private: System::Windows::Forms::Label^  label3;




	private: System::Windows::Forms::Button^  createNewButton;
	private: System::Windows::Forms::Button^  deleteButton;

	private: ManagedItemList^ m_ItemList;
	private: ManagedItem^ m_currentItem;
	private: System::Windows::Forms::CheckBox^  RelationshipBox;


	private: CheckBox^  InspectBox;
	private: CheckBox^  PickupBox;
	private: System::Windows::Forms::Button^  saveButton;



	private: System::ComponentModel::IContainer^  components;

	//protected: 

	//protected: 


#pragma region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		void InitializeComponent(void)
		{
			this->itemNameList = (gcnew System::Windows::Forms::ListBox());
			this->label1 = (gcnew System::Windows::Forms::Label());
			this->itemImage = (gcnew System::Windows::Forms::PictureBox());
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
			this->saveButton = (gcnew System::Windows::Forms::Button());
			this->RelationshipBox = (gcnew System::Windows::Forms::CheckBox());
			this->InspectBox = (gcnew System::Windows::Forms::CheckBox());
			this->PickupBox = (gcnew System::Windows::Forms::CheckBox());
			this->label3 = (gcnew System::Windows::Forms::Label());
			this->itemDescriptionBox = (gcnew System::Windows::Forms::RichTextBox());
			this->label2 = (gcnew System::Windows::Forms::Label());
			this->createNewButton = (gcnew System::Windows::Forms::Button());
			this->deleteButton = (gcnew System::Windows::Forms::Button());
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->itemImage))->BeginInit();
			this->groupBox1->SuspendLayout();
			this->SuspendLayout();
			// 
			// itemNameList
			// 
			this->itemNameList->FormattingEnabled = true;
			this->itemNameList->Location = System::Drawing::Point(12, 25);
			this->itemNameList->Name = L"itemNameList";
			this->itemNameList->ScrollAlwaysVisible = true;
			this->itemNameList->Size = System::Drawing::Size(125, 368);
			this->itemNameList->TabIndex = 0;
			this->itemNameList->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::itemNameList_SelectedIndexChanged);
			// 
			// label1
			// 
			this->label1->AutoSize = true;
			this->label1->Location = System::Drawing::Point(12, 9);
			this->label1->Name = L"label1";
			this->label1->Size = System::Drawing::Size(58, 13);
			this->label1->TabIndex = 1;
			this->label1->Text = L"Item Name";
			// 
			// itemImage
			// 
			this->itemImage->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
			this->itemImage->Location = System::Drawing::Point(6, 35);
			this->itemImage->Name = L"itemImage";
			this->itemImage->Size = System::Drawing::Size(299, 76);
			this->itemImage->TabIndex = 2;
			this->itemImage->TabStop = false;
			this->itemImage->Click += gcnew System::EventHandler(this, &Form1::itemImage_Click);
			// 
			// groupBox1
			// 
			this->groupBox1->Controls->Add(this->saveButton);
			this->groupBox1->Controls->Add(this->RelationshipBox);
			this->groupBox1->Controls->Add(this->InspectBox);
			this->groupBox1->Controls->Add(this->PickupBox);
			this->groupBox1->Controls->Add(this->label3);
			this->groupBox1->Controls->Add(this->itemDescriptionBox);
			this->groupBox1->Controls->Add(this->label2);
			this->groupBox1->Controls->Add(this->itemImage);
			this->groupBox1->Location = System::Drawing::Point(141, 25);
			this->groupBox1->Name = L"groupBox1";
			this->groupBox1->Size = System::Drawing::Size(327, 367);
			this->groupBox1->TabIndex = 3;
			this->groupBox1->TabStop = false;
			this->groupBox1->Text = L"Item Properties";
			// 
			// saveButton
			// 
			this->saveButton->Location = System::Drawing::Point(7, 256);
			this->saveButton->Name = L"saveButton";
			this->saveButton->Size = System::Drawing::Size(75, 23);
			this->saveButton->TabIndex = 12;
			this->saveButton->Text = L"Save";
			this->saveButton->UseVisualStyleBackColor = true;
			this->saveButton->Click += gcnew System::EventHandler(this, &Form1::saveButton_Click);
			// 
			// RelationshipBox
			// 
			this->RelationshipBox->AutoSize = true;
			this->RelationshipBox->Location = System::Drawing::Point(215, 344);
			this->RelationshipBox->Name = L"RelationshipBox";
			this->RelationshipBox->Size = System::Drawing::Size(106, 17);
			this->RelationshipBox->TabIndex = 11;
			this->RelationshipBox->TabStop = false;
			this->RelationshipBox->Text = L"Has Relationship";
			this->RelationshipBox->UseVisualStyleBackColor = true;
			this->RelationshipBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::RelationshipBox_CheckedChanged);
			// 
			// InspectBox
			// 
			this->InspectBox->AutoSize = true;
			this->InspectBox->Location = System::Drawing::Point(111, 344);
			this->InspectBox->Name = L"InspectBox";
			this->InspectBox->Size = System::Drawing::Size(81, 17);
			this->InspectBox->TabIndex = 10;
			this->InspectBox->TabStop = false;
			this->InspectBox->Text = L"Inspectable";
			this->InspectBox->UseVisualStyleBackColor = true;
			this->InspectBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::InspectBox_CheckedChanged);
			// 
			// PickupBox
			// 
			this->PickupBox->AutoSize = true;
			this->PickupBox->Location = System::Drawing::Point(6, 344);
			this->PickupBox->Name = L"PickupBox";
			this->PickupBox->Size = System::Drawing::Size(79, 17);
			this->PickupBox->TabIndex = 9;
			this->PickupBox->TabStop = false;
			this->PickupBox->Text = L"Pickupable";
			this->PickupBox->UseVisualStyleBackColor = true;
			this->PickupBox->CheckedChanged += gcnew System::EventHandler(this, &Form1::PickupBox_CheckedChanged);
			// 
			// label3
			// 
			this->label3->AutoSize = true;
			this->label3->Location = System::Drawing::Point(6, 154);
			this->label3->Name = L"label3";
			this->label3->Size = System::Drawing::Size(83, 13);
			this->label3->TabIndex = 5;
			this->label3->Text = L"Item Description";
			// 
			// itemDescriptionBox
			// 
			this->itemDescriptionBox->Location = System::Drawing::Point(6, 170);
			this->itemDescriptionBox->Name = L"itemDescriptionBox";
			this->itemDescriptionBox->Size = System::Drawing::Size(299, 79);
			this->itemDescriptionBox->TabIndex = 4;
			this->itemDescriptionBox->Text = L"";
			this->itemDescriptionBox->TextChanged += gcnew System::EventHandler(this, &Form1::ItemDescriptionBox_TextChanged);
			// 
			// label2
			// 
			this->label2->AutoSize = true;
			this->label2->Location = System::Drawing::Point(6, 19);
			this->label2->Name = L"label2";
			this->label2->Size = System::Drawing::Size(83, 13);
			this->label2->TabIndex = 3;
			this->label2->Text = L"Inventory Image";
			// 
			// createNewButton
			// 
			this->createNewButton->Location = System::Drawing::Point(12, 399);
			this->createNewButton->Name = L"createNewButton";
			this->createNewButton->Size = System::Drawing::Size(125, 26);
			this->createNewButton->TabIndex = 6;
			this->createNewButton->Text = L"Create New";
			this->createNewButton->UseVisualStyleBackColor = true;
			this->createNewButton->Click += gcnew System::EventHandler(this, &Form1::createNewButton_Click);
			// 
			// deleteButton
			// 
			this->deleteButton->Location = System::Drawing::Point(12, 431);
			this->deleteButton->Name = L"deleteButton";
			this->deleteButton->Size = System::Drawing::Size(125, 25);
			this->deleteButton->TabIndex = 7;
			this->deleteButton->Text = L"Delete";
			this->deleteButton->UseVisualStyleBackColor = true;
			this->deleteButton->Click += gcnew System::EventHandler(this, &Form1::deleteButton_Click);
			// 
			// Form1
			// 
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
			this->AutoSize = true;
			this->ClientSize = System::Drawing::Size(478, 473);
			this->Controls->Add(this->deleteButton);
			this->Controls->Add(this->createNewButton);
			this->Controls->Add(this->groupBox1);
			this->Controls->Add(this->label1);
			this->Controls->Add(this->itemNameList);
			this->Name = L"Form1";
			this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
			this->Text = L"Item Manager";
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->itemImage))->EndInit();
			this->groupBox1->ResumeLayout(false);
			this->groupBox1->PerformLayout();
			this->ResumeLayout(false);
			this->PerformLayout();

		}
#pragma endregion
private: System::Void File_Opening(System::Object^  sender, System::ComponentModel::CancelEventArgs^  e) {
		 }
private: System::Void itemNameList_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
private: System::Void DebugBox_TextChanged(System::Object^  sender, System::EventArgs^  e) {
		 }

private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
			 
		 }
private: System::Void ItemDescriptionBox_TextChanged(System::Object^  sender, System::EventArgs^  e);
private: System::Void itemImage_Click(System::Object^  sender, System::EventArgs^  e) {
		 }
private: System::Void createNewButton_Click(System::Object^  sender, System::EventArgs^  e);
private: System::Void deleteButton_Click(System::Object^  sender, System::EventArgs^  e);

private: Void disableProperties(){
			 label2->Enabled = false;
			 label3->Enabled = false;
			 itemDescriptionBox->Enabled = false;
			 itemImage->Enabled = false;
			 RelationshipBox->Enabled = false;
			 PickupBox->Enabled = false;
			 InspectBox->Enabled = false;
			 saveButton->Enabled = false;
		 }
private: Void enableProperties(){
			 label2->Enabled = true;
			 label3->Enabled = true;
			 itemDescriptionBox->Enabled = true;
			 itemImage->Enabled = true;
			 RelationshipBox->Enabled = true;
			 PickupBox->Enabled = true;
			 InspectBox->Enabled = true;
			 saveButton->Enabled = true;
		 }
private: System::Void saveButton_Click(System::Object^  sender, System::EventArgs^  e) {
			 m_ItemList[itemNameList->SelectedIndex]->setItemDescription(itemDescriptionBox->Text);
			 System::Windows::Forms::MessageBox::Show("Not sure if Items should have a save button, or if changes are automatically saved.  What do you think?", "Need Feedback");
		 }
private: System::Void PickupBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e){}
private: System::Void InspectBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e){}
private: System::Void RelationshipBox_CheckedChanged(System::Object^  sender, System::EventArgs^  e){}

private: Void	 InspectBox_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e);
private: Void	 RelationshipBox_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e);
private: Void	 PickupBox_MouseClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e);
};
}